import { User } from './../../interfaces/request.interface';
import { UserService } from '../user/user.service';
import { Injectable } from '@nestjs/common';
import { JwtService } from '@nestjs/jwt';

@Injectable()
export class AuthService {
    constructor(
        private readonly jwtServ: JwtService,
    ) { }

     
    /**
     * @return 返回token
     */
    sign(payload: User): string {
        return this.jwtServ.sign(payload);
    }

    decode(token) {
        return this.jwtServ.decode(token);
    }
}
